@extends('layout.index')

@section('content')
<div class="mws-panel grid_8">
  <div class="mws-panel-header">
    <span>
      <i class="icon-table"></i>商品列表</span>
  </div>
  <div class="mws-panel-body no-padding">
    <div role="grid" class="dataTables_wrapper" id="DataTables_Table_1_wrapper">

	<form action="/admin/goods/index" method='get'>
      <div id="DataTables_Table_1_length" class="dataTables_length">
         <label>显示
          <select name="num" size="1" aria-controls="DataTables_Table_1">
            <option value="10" @if(!empty($request['num']) && $request['num'] == 10) 
                  selected
            @endif
            >10</option>
            <option value="25" @if(!empty($request['num']) && $request['num'] == 25)
                  selected
            @endif
            >25</option>
            <option value="50" @if(!empty($request['num']) && $request['num'] == 50) 
                  selected
            @endif
            >50</option>
            <option value="100" @if(!empty($request['num']) && $request['num'] == 100 )
                  selected
            @endif
            >100</option>
          </select>条数据</label>
      </div>
      <div class="dataTables_filter" id="DataTables_Table_1_filter">
        <label>关键字:
          <input type="text" name= 'search' aria-controls="DataTables_Table_1">
         </label>
         <button class='btn btn-info'>点击搜索</button>
      </div>
	</form>

      <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
        <thead>
          <tr role="row">
            <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 185px;" aria-sort="ascending" aria-label="Rendering engine: activate to sort column descending">ID</th>
            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 239px;" aria-label="Browser: activate to sort column ascending">商品名</th>
            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 225px;" aria-label="Platform(s): activate to sort column ascending">商品图片</th>
             <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 225px;" aria-label="Platform(s): activate to sort column ascending">商品价格</th>
            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 225px;" aria-label="Platform(s): activate to sort column ascending">商品描述</th>
            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 225px;" aria-label="Platform(s): activate to sort column ascending">商品库存</th>
            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 157px;" aria-label="Engine version: activate to sort column ascending">状态</th>
            <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width: 115px;" aria-label="CSS grade: activate to sort column ascending">操作</th></tr>
        </thead>
        <tbody role="alert" aria-live="polite" aria-relevant="all">
        @foreach($row as $k => $v)
          <tr class="@if($k % 2 == 0)
					even
					@else 
					odd
					@endif
          ">
          
            <td class="  sorting_1">{{$v->id}}</td>
            <td class=" ">{{$v->goodsname}}</td>
            <td class=""><img src="{{$v->goodspic}}" style='height:80px width:80px'></td>
            <td class=" ">{{$v->goodsprice}}</td>
            <td class=" ">{{$v->goodsdesc}}</td>
            <td class=" ">{{$v->goodsnum}}</td>
            <td class=" ">@if( $v->status==1 )
             上架
             @else下架

          @endif</td>
            <td class=" "><a href="/admin/goods/edit?id={{$v->id}}" style='color:black'><i class="icon-pencil"></i></a>&nbsp;&nbsp; <a href="/admin/goods/delete?id={{$v->id}}" style='color:black'><i class="icon-trash"></i></a></td>
          </tr>
		@endforeach
        </tbody>
      </table>

      <div class="dataTables_paginate paging_full_numbers" id="pages">

       {!! $row->appends($request)->render()!!}    
    </div>
  </div>
</div>
@endsection